package com.fdb.efp.esb.service.impl.kfpt;

import java.util.Map;

import com.fdb.efp.esb.common.client.resp.EsbRespServiceBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.fdb.efp.esb.service.bo.req.kfpt.LoanResultCallReqBean;
import com.fdb.efp.esb.service.client.ESBClientFactory;
import com.fdb.efp.esb.service.facade.kfpt.LoanResultCallService;

/**
 * @description:放款结果回调服务入口
 * @date:2018年12月18日 上午11:03:03
 * @author:wangyk3
 */
@Service("loanResultCallService")
public class LoanResultCallServiceImpl implements LoanResultCallService {
	private static Logger logger = LoggerFactory.getLogger(LoanResultCallServiceImpl.class);
	
	/**
	 * @description:放款结果方法入口
	 * @param loanResultCallReqBean
	 * @return
	 * @date:2018年12月18日 下午2:16:17
	 * @author:wangyk3
	 */
	@Override
	public Map<String, Object> loanResultCall(LoanResultCallReqBean loanResultCallReqBean) {
		// 进件申请信息
		logger.info("订单号：" + loanResultCallReqBean.getLoanListid() + "放款结果回调交易开始");
		String tradeNo = "";
		try {
			
			// 3.反馈放款结果
			EsbRespServiceBean returnBean = ESBClientFactory.buildClient().withBody(loanResultCallReqBean)
					.withTradeNo(tradeNo).create().sendAndReceive();
			
			// 4.根据返回状态更改回调信息状态
		} catch (Exception e) {
			// TODO: handle exception
		}
		logger.info("订单号：" + loanResultCallReqBean.getLoanListid() + "放款结果回调交易结束");
		return null;
	}

}
